<?php
class programme_language extends Model{
	public static function getTableName(){
		return 'programme-language';
	}

    public function getPrimaryKey()
    {
        return array('programme_id', 'language_id');
    }

	public function set($object){
		$this->programme_id= !isset($object->programme_id) ? '' : trim($object->programme_id);
		$this->language_id= !isset($object->language_id) ? '' : trim($object->language_id);
		$this->title= !isset($object->title) ? '' : trim($object->title);
		$this->first_onair_information= !isset($object->first_onair_information) ? '' : trim($object->first_onair_information);
		$this->settop_box_name= !isset($object->settop_box_name) ? '' : $object->settop_box_name;
		$this->description= !isset($object->description) ? '' : $object->description;
		$this->description_short= !isset($object->description_short) ? '' : $object->description_short;
		$this->fact_background= !isset($object->fact_background) ? '' : $object->fact_background;
		$this->objective= !isset($object->objective) ? '' : $object->objective;
	}

	public function getLangProgrammeByID($id, $lan_id)
	{
		$ret = Model::$dbo["r"]->findBySql(__class__, "select * from `programme-language` where programme_id={$id} and language_id={$lan_id}"); 
		return isset($ret[0]) ? $ret[0] : '';
	}
}
?>
